home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / X11 / XrmInitialize.z / XrmInitialize
Encoding:
Text File  |  1998-10-30  |  7.4 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXrrrrmmmmIIIInnnniiiittttiiiiaaaalllliiiizzzzeeee((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXrrrrmmmmIIIInnnniiiittttiiiiaaaalllliiiizzzzeeee((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XrmInitialize, XrmParseCommand, XrmValue, XrmOptionKind,
  10.           XrmOptionDescRec - initialize the Resource Manager, Resource
  11.           Manager structures, and parse the command line
  12.  
  13.      SSSSYYYYNNNNTTTTAAAAXXXX
  14.           void XrmInitialize();
  15.  
  16.           void XrmParseCommand(_d_a_t_a_b_a_s_e, _t_a_b_l_e, _t_a_b_l_e__c_o_u_n_t, _n_a_m_e,
  17.           _a_r_g_c__i_n__o_u_t, _a_r_g_v__i_n__o_u_t)
  18.                 XrmDatabase *_d_a_t_a_b_a_s_e;
  19.                 XrmOptionDescList _t_a_b_l_e;
  20.                 int _t_a_b_l_e__c_o_u_n_t;
  21.                 char *_n_a_m_e;
  22.                 int *_a_r_g_c__i_n__o_u_t;
  23.                 char **_a_r_g_v__i_n__o_u_t;
  24.  
  25.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  26.           _a_r_g_c__i_n__o_u_t
  27.                     Specifies the number of arguments and returns the
  28.                     number of remaining arguments.
  29.  
  30.           _a_r_g_v__i_n__o_u_t
  31.                     Specifies the command line arguments and returns
  32.                     the remaining arguments.
  33.  
  34.           _d_a_t_a_b_a_s_e  Specifies the resource database.
  35.  
  36.           _n_a_m_e      Specifies the application name.
  37.  
  38.           _t_a_b_l_e     Specifies the table of command line arguments to
  39.                     be parsed.
  40.  
  41.           _t_a_b_l_e__c_o_u_n_t
  42.                     Specifies the number of entries in the table.
  43.  
  44.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  45.           The _X_r_m_I_n_i_t_i_a_l_i_z_e function initialize the resource manager.
  46.           It must be called before any other Xrm functions are used.
  47.  
  48.           The _X_r_m_P_a_r_s_e_C_o_m_m_a_n_d function parses an (argc, argv) pair
  49.           according to the specified option table, loads recognized
  50.           options into the specified database with type ``String,''
  51.           and modifies the (argc, argv) pair to remove all recognized
  52.           options.  If database contains NULL, _X_r_m_P_a_r_s_e_C_o_m_m_a_n_d creates
  53.           a new database and returns a pointer to it.  Otherwise,
  54.           entries are added to the database specified.  If a database
  55.           is created, it is created in the current locale.
  56.  
  57.           The specified table is used to parse the command line.
  58.           Recognized options in the table are removed from argv, and
  59.           entries are added to the specified resource database in the
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXrrrrmmmmIIIInnnniiiittttiiiiaaaalllliiiizzzzeeee((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXrrrrmmmmIIIInnnniiiittttiiiiaaaalllliiiizzzzeeee((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.           order they occur in argv.  The table entries contain
  75.           information on the option string, the option name, the style
  76.           of option, and a value to provide if the option kind is
  77.           _X_r_m_o_p_t_i_o_n_N_o_A_r_g.  The option names are compared byte-for-byte
  78.           to arguments in argv, independent of any locale.  The
  79.           resource values given in the table are stored in the
  80.           resource database without modification.  All resource
  81.           database entries are created using a ``String''
  82.           representation type.  The argc argument specifies the number
  83.           of arguments in argv and is set on return to the remaining
  84.           number of arguments that were not parsed.  The name argument
  85.           should be the name of your application for use in building
  86.           the database entry.  The name argument is prefixed to the
  87.           resourceName in the option table before storing a database
  88.           entry.  The name argument is treated as a single component,
  89.           even if it has embedded periods.  No separating (binding)
  90.           character is inserted, so the table must contain either a
  91.           period (.) or an asterisk (*) as the first character in each
  92.           resourceName entry.  To specify a more completely qualified
  93.           resource name, the resourceName entry can contain multiple
  94.           components.  If the name argument and the resourceNames are
  95.           not in the Host Portable Character Encoding, the result is
  96.           implementation-dependent.
  97.  
  98.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  99.           The _X_r_m_V_a_l_u_e, _X_r_m_O_p_t_i_o_n_K_i_n_d, and _X_r_m_O_p_t_i_o_n_D_e_s_c_R_e_c structures
  100.           contain:
  101.  
  102.           typedef struct {
  103.                unsigned int size;
  104.                XPointer addr;
  105.           } XrmValue, *XrmValuePtr;
  106.  
  107.           typedef enum {
  108.                XrmoptionNoArg,     /* Value is specified in XrmOptionDescRec.value */
  109.                XrmoptionIsArg,     /* Value is the option string itself */
  110.                XrmoptionStickyArg, /* Value is characters immediately following option */
  111.                XrmoptionSepArg,    /* Value is next argument in argv */
  112.                XrmoptionResArg,    /* Resource and value in next argument in argv */
  113.                XrmoptionSkipArg,   /* Ignore this option and the next argument in argv */
  114.                XrmoptionSkipLine,  /* Ignore this option and the rest of argv */
  115.                XrmoptionSkipNArgs  /* Ignore this option and the next
  116.                                       XrmOptionDescRec.value arguments in argv */
  117.           } XrmOptionKind;
  118.  
  119.           typedef struct {
  120.                char *option;       /* Option specification string in argv    */
  121.                char *specifier;    /* Binding and resource name (sans application name)    */
  122.                XrmOptionKind argKind;/* Which style of option it is    */
  123.                XPointer value;     /* Value to provide if XrmoptionNoArg or
  124.                                       XrmoptionSkipNArgs   */
  125.           } XrmOptionDescRec, *XrmOptionDescList;
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXrrrrmmmmIIIInnnniiiittttiiiiaaaalllliiiizzzzeeee((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333)))) XXXXrrrrmmmmIIIInnnniiiittttiiiiaaaalllliiiizzzzeeee((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  141.           XrmGetResource(3X11), XrmMergeDatabases(3X11),
  142.           XrmPutResource(3X11), XrmUniqueQuark(3X11)
  143.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.